using UnityEngine;
using System.Collections;
using System;

public class MeuGame : MonoBehaviour {
	
	Mecanica movimento = new Mecanica();
	GameObject player;
	CharacterController controler;
	String playerClone;
	public Transform[] avatar = new Transform[11];
	public Transform balas;
	String playerEnter;
	int playerNum;
	int animationNum;
	Vector3 posTiro;
	Transform fire;
	void noAr()
	{
		playerEnter = Network.player.ToString();
		playerNum = int.Parse(playerEnter);
		Network.Instantiate(avatar[playerNum],transform.position,transform.rotation,0);
	}
	
	void Update()
	{		
		if(Input.GetKeyDown("space"))
		{
			fire = GameObject.Find("Fire"+playerEnter).transform;
			posTiro = fire.position;
			Network.Instantiate(balas,posTiro,fire.rotation,0);
		}
	}

}

